Skip to content

Conversation

@gramian
Copy link
Collaborator

@gramian gramian commented Nov 2, 2023

What does this PR do?

This change adds a check for two empty strings to be compared to the equalsString method of the BinaryComparator class. As far as I understand it, strings are compared as byte arrays which can cause the observed error when comparing the last byte. However for a length of zero, as an empty string has, this causes an error.

Now I cannot say why this error does not happen with the current repo head, but I think it should or still might, thus I added this check for both argument strings being empty and preventing this error.

Related issues

#1297

Additional Notes

This specifically does not add the check to the equalsBytes as I do not know if a zero length array can actually be created.

Checklist

  • I have run the build using mvn clean package command
  • My unit tests cover both failure and success scenarios

if (buffer1 == null || buffer2 == null)
return false;

if (buffer1.equals("") && buffer2.equals(""))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could be more efficient doing if( buffer1.isEmpty() && buffer2.isEmpty() )

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@lvca lvca self-requested a review November 5, 2023 18:00
@lvca lvca added the bug label Nov 5, 2023
@lvca lvca added this to the 23.11.1 milestone Nov 5, 2023
@mergify mergify bot merged commit b1166c1 into ArcadeData:main Nov 5, 2023
mergify bot added a commit that referenced this pull request Dec 1, 2025
… to 2.20.1 [skip ci]

Bumps [org.codehaus.mojo:versions-maven-plugin](https://github.com/mojohaus/versions) from 2.19.1 to 2.20.1.
Release notes

*Sourced from [org.codehaus.mojo:versions-maven-plugin's releases](https://github.com/mojohaus/versions/releases).*

> 2.20.1
> ------
>
> 🐛 Bug Fixes
> -----------
>
> * Fixed [#1313](https://github.com/mojohaus/versions/issues/1313): Do not show existing version as update ([#1315](https://github.com/mojohaus/versions/pull/1315)) [`@​andrzejj0`](https://github.com/andrzejj0)
>
> 2.20.0
> ------
>
> 🚀 New features and improvements
> -------------------------------
>
> * Allow filtering out pre releases in use-latest-versions ([#1283](https://github.com/mojohaus/versions/pull/1283)) [`@​Artur`](https://github.com/Artur)-
> * [#979](https://github.com/mojohaus/versions/issues/979): Output file is not overwritten by default ([#1279](https://github.com/mojohaus/versions/pull/1279)) [`@​andrzejj0`](https://github.com/andrzejj0)
>
> 🐛 Bug Fixes
> -----------
>
> * Fixed a problem with dependency management filtering in the logged results ([#1298](https://github.com/mojohaus/versions/pull/1298)) [`@​andrzejj0`](https://github.com/andrzejj0)
> * Fixes [#1295](https://github.com/mojohaus/versions/issues/1295): getAllUpdates(boolean) should respect currentVersionRange ([#1297](https://github.com/mojohaus/versions/pull/1297)) [`@​andrzejj0`](https://github.com/andrzejj0)
> * Fixed [#1287](https://github.com/mojohaus/versions/issues/1287) - Versionless dependencies in dependencyManagement accepted by maven, but not bij resolve-ranges ([#1288](https://github.com/mojohaus/versions/pull/1288)) [`@​maroschutte`](https://github.com/maroschutte)
> * Artifact comparison should use semantic version comparison. ([#1281](https://github.com/mojohaus/versions/pull/1281)) [`@​andrzejj0`](https://github.com/andrzejj0)
> * Resolves [#1150](https://github.com/mojohaus/versions/issues/1150): Resolve multiple level properties (properties resolving to properties) ([#1276](https://github.com/mojohaus/versions/pull/1276)) [`@​andrzejj0`](https://github.com/andrzejj0)
>
> 📝 Documentation updates
> -----------------------
>
> * Add more examples of ignoredVersions config parameter ([#1296](https://github.com/mojohaus/versions/pull/1296)) [`@​mikkoi`](https://github.com/mikkoi)
> * Fix broken href link in site ([#1294](https://github.com/mojohaus/versions/pull/1294)) [`@​mikkoi`](https://github.com/mikkoi)
> * Added remaining javadoc comments. ([#1293](https://github.com/mojohaus/versions/pull/1293)) [`@​andrzejj0`](https://github.com/andrzejj0)
> * Getting rid of javadoc warnings ([#1292](https://github.com/mojohaus/versions/pull/1292)) [`@​andrzejj0`](https://github.com/andrzejj0)
>
> 👻 Maintenance
> -------------
>
> * ResolverAdapter: a thin adapter over Resolver ([#1301](https://github.com/mojohaus/versions/pull/1301)) [`@​andrzejj0`](https://github.com/andrzejj0)
> * Fixed a problem with dependency management filtering in the logged results ([#1298](https://github.com/mojohaus/versions/pull/1298)) [`@​andrzejj0`](https://github.com/andrzejj0)
> * Fix broken href link in site ([#1294](https://github.com/mojohaus/versions/pull/1294)) [`@​mikkoi`](https://github.com/mikkoi)
> * Added remaining javadoc comments. ([#1293](https://github.com/mojohaus/versions/pull/1293)) [`@​andrzejj0`](https://github.com/andrzejj0)
> * Getting rid of javadoc warnings ([#1292](https://github.com/mojohaus/versions/pull/1292)) [`@​andrzejj0`](https://github.com/andrzejj0)
> * Removed a redundant integration test ([#1280](https://github.com/mojohaus/versions/pull/1280)) [`@​andrzejj0`](https://github.com/andrzejj0)
>
> 📦 Dependency updates
> --------------------
>
> * Bump org.apache.commons:commons-lang3 from 3.19.0 to 3.20.0 ([#1312](https://github.com/mojohaus/versions/pull/1312)) @[dependabot[bot]](https://github.com/apps/dependabot)
> * Bump byteBuddyVersion from 1.18.0 to 1.18.1 ([#1311](https://github.com/mojohaus/versions/pull/1311)) @[dependabot[bot]](https://github.com/apps/dependabot)
> * Bump org.codehaus.plexus:plexus-archiver from 4.10.3 to 4.10.4 ([#1307](https://github.com/mojohaus/versions/pull/1307)) @[dependabot[bot]](https://github.com/apps/dependabot)
> * Bump byteBuddyVersion from 1.17.7 to 1.18.0 ([#1309](https://github.com/mojohaus/versions/pull/1309)) @[dependabot[bot]](https://github.com/apps/dependabot)
> * Bump commons-codec:commons-codec from 1.19.0 to 1.20.0 ([#1303](https://github.com/mojohaus/versions/pull/1303)) @[dependabot[bot]](https://github.com/apps/dependabot)
> * Bump commons-io:commons-io from 2.20.0 to 2.21.0 ([#1305](https://github.com/mojohaus/versions/pull/1305)) @[dependabot[bot]](https://github.com/apps/dependabot)
> * Bump org.codehaus.plexus:plexus-i18n from 1.0.0 to 1.1.0 ([#1306](https://github.com/mojohaus/versions/pull/1306)) @[dependabot[bot]](https://github.com/apps/dependabot)
> * Bump org.codehaus.plexus:plexus-interactivity-api from 1.4 to 1.5.1 ([#1308](https://github.com/mojohaus/versions/pull/1308)) @[dependabot[bot]](https://github.com/apps/dependabot)
> * Bump org.apache.maven.plugin-testing:maven-plugin-testing-harness from 3.3.0 to 3.4.0 ([#1302](https://github.com/mojohaus/versions/pull/1302)) @[dependabot[bot]](https://github.com/apps/dependabot)
> * Bump org.codehaus.plexus:plexus-archiver from 4.10.2 to 4.10.3 ([#1290](https://github.com/mojohaus/versions/pull/1290)) @[dependabot[bot]](https://github.com/apps/dependabot)
> * Bump org.codehaus.mojo:mojo-parent from 93 to 94 ([#1285](https://github.com/mojohaus/versions/pull/1285)) @[dependabot[bot]](https://github.com/apps/dependabot)

... (truncated)


Commits

* [`b296a4f`](mojohaus/versions@b296a4f) [maven-release-plugin] prepare release 2.20.1
* [`b243939`](mojohaus/versions@b243939) Fixed [#1313](https://github.com/mojohaus/versions/issues/1313): Do not show existing version as update ([#1315](https://github.com/mojohaus/versions/issues/1315))
* [`773d0f3`](mojohaus/versions@773d0f3) [maven-release-plugin] prepare for next development iteration
* [`2467d99`](mojohaus/versions@2467d99) [maven-release-plugin] prepare release 2.20.0
* [`4c240e7`](mojohaus/versions@4c240e7) Bump org.apache.commons:commons-lang3 from 3.19.0 to 3.20.0
* [`6d64537`](mojohaus/versions@6d64537) Bump byteBuddyVersion from 1.18.0 to 1.18.1
* [`7736ca6`](mojohaus/versions@7736ca6) Bump org.codehaus.plexus:plexus-archiver from 4.10.3 to 4.10.4
* [`37a5330`](mojohaus/versions@37a5330) Bump byteBuddyVersion from 1.17.7 to 1.18.0
* [`edeb5e7`](mojohaus/versions@edeb5e7) Bump commons-codec:commons-codec from 1.19.0 to 1.20.0
* [`88874e0`](mojohaus/versions@88874e0) Bump commons-io:commons-io from 2.20.0 to 2.21.0
* Additional commits viewable in [compare view](mojohaus/versions@2.19.1...2.20.1)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=org.codehaus.mojo:versions-maven-plugin&package-manager=maven&previous-version=2.19.1&new-version=2.20.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants